package com.jarvis.pzz;

import android.Manifest;
import android.content.Intent;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import com.bumptech.glide.Glide;
import com.jarvis.bottomnavigationviewlibrary.BottomNavigationItem;
import com.jarvis.bottomnavigationviewlibrary.BottomNavigationView;
import com.jarvis.bottomnavigationviewlibrary.OnBottomNavigationItemClickListener;
import com.jarvis.pzz.common.BaseActivity;
import com.jarvis.pzz.models.AdvertisesmetListModel;
import com.jarvis.pzz.widget.BannerHeaderView;
import com.jarvis.pzz.widget.MoreImageView;
import com.jarvis.pzz.widget.ZoomImageView;
import com.tbruyelle.rxpermissions.RxPermissions;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import rx.functions.Action1;

public class PhotoActivity extends BaseActivity {
    @BindView(R.id.banner)
    MoreImageView banner;
    @BindView(R.id.rel_left)
    RelativeLayout rel_left;
    private List<AdvertisesmetListModel> advList = new ArrayList<>();

    @Override
    public int getLayoutId() {
        return R.layout.activity_photo;
    }

    @Override
    public void initData() {
        Intent intent = getIntent();
        int postion = intent.getIntExtra("postion", 0);
        advList=(List<AdvertisesmetListModel>)intent.getSerializableExtra("advList");
        List<String> urlList=new ArrayList<>();
        for (int i = 0; i <advList.size() ; i++) {
            urlList.add(advList.get(i).getAdvImgPath());
        }
        banner.setImgUrlData(urlList,postion);
    }

    @Override
    public void initView() {
        setStatus(false);
        rel_left.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }
}
